#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string>
#include <fstream>
#include <math.h>
#include <cstdlib>
#include <unistd.h>
#include <vector>
#include <algorithm>

using namespace std;


class histo{
public:
  vector <double> p;
  vector <double> bin;
  double lo;
  double hi;
  long N;
  double step;

  histo()
  {
  };
  
  histo(double _lo, double _hi, long _N)
  {
    N=_N;
    lo=_lo;
    hi=_hi;
    step=(hi-lo)/N;

    // divide the range in N bins
    bin.insert(bin.end(),N,0);

    //    cout << lo << " " << hi << " " << step << " " << bin.size() << endl;
    
  };
  
  histo(double _lo, double _hi, double _step)
  {
    lo=_lo;
    hi=_hi;
    step=_step;
    N=(long)((hi-lo)/step);

    // divide the range in N bins
    bin.insert(bin.end(),N,0);

    //    cout << lo << " " << hi << " " << step << " " << bin.size() << endl;
    
  };

  void init(double _lo, double _hi, long _N)
  {
    N=_N;
    lo=_lo;
    hi=_hi;
    step=(hi-lo)/N;

    // divide the range in N bins
    bin.insert(bin.end(),N,0);

    //    cout << lo << " " << hi << " " << step << " " << bin.size() << endl;
    
  };
  
  void init(double _lo, double _hi, double _step)
  {
    lo=_lo;
    hi=_hi;
    step=_step;
    N=(long)((hi-lo)/step);

    // divide the range in N bins
    bin.insert(bin.end(),N,0);

    //    cout << lo << " " << hi << " " << step << " " << bin.size() << endl;
    
  };

  int addPoint(double value)
  {
    if ((value>=lo)&&(value<=hi))
      p.push_back(value);
    else
      return -1;
    return 0;
  };

  int addPoint(string line)
  {
    double value;
    sscanf(&line.at(0), "%lf", &value);
    //    cout << line << " " << p.size() << endl;
    if ((value>=lo)&&(value<=hi))
      p.push_back(value);
    else
      return 0;
    return 1;
  };

  void sortPoints()
  {
    sort(p.begin(), p.end());
  };

  long translate(double val)
  {
    return (long) ((val-lo)/step);
  };
  
  void values2bin()
  {
    for (long i = 0 ; i< p.size(); i++)
      //      cout << p[i] << endl;
      bin[translate(p[i])]++;
  };

  void printBins()
  {
    for (long i=0; i<bin.size(); i++)
      printf("%10.5lf %10.5lf %10.5lf\n", i*step+lo, (i+1)*step+lo, bin[i]);

  };

  void printBinsNormalized()
  {
    double total=0;
    for (long i=0; i<bin.size(); i++)
      total+=bin[i];
    for (long i=0; i<bin.size(); i++)
      printf("%10.5lf %10.5lf %10.5lf %10.5lf %10.5lf\n", i*step+lo, (i+1)*step+lo, bin[i], bin[i]/total, sqrt(bin[i])/total);

  };
};


int main(int argc, char** argv)
{
  string line;
  double lo=0.0, hi=1.0;
  long Nbin=100;
  int modeN=1;
  double step=0.1;
  
  opterr = 0;
  int c;
  while ((c = getopt (argc, argv, "l:h:N:s:r::")) != -1)
    switch (c)
      {
      case 'r':
	lo=atof(optarg);
	hi=atof(optarg);
        break;
      case 'l':
	lo=atof(optarg);
        break;
      case 'h':
	hi=atof(optarg);	
        break;
      case 'N':
	Nbin=atol(optarg);	
        break;
      case 's':
	step=atof(optarg);
	modeN=0;
	break;
      case '?':
        if (optopt == 'G')
          fprintf (stderr, "Option -%c requires an argument.\n", optopt);
        else if (optopt == 'p')
          fprintf (stderr, "Option -%c requires an argument.\n", optopt);
        else if (isprint (optopt))
          fprintf (stderr, "Unknown option `-%c'.\n", optopt);
        else
          fprintf (stderr,
                   "Unknown option character `\\x%x'.\n",
                   optopt);
        return 1;
      default:
        abort ();
      }

  histo H;
  
  if (modeN)
    H.init(lo,hi,Nbin);
  else
    H.init(lo,hi,step);
    
  
  while(cin)
    {
      getline(cin, line);
      if (line.length()>0)
	H.addPoint(line);
    }

  //H.sortPoints();
  
  H.values2bin();

  H.printBinsNormalized();
}
